<template>
  <div class="user-auth-container">
    <div class="auth-card">
      <!-- 登录和注册的标签页 -->
      <el-tabs v-model="activeTab" class="auth-tabs" @tab-change="handleTabChange">
        <el-tab-pane label="用户登录" name="login">
          <UserLogin />
        </el-tab-pane>
        <el-tab-pane label="用户注册" name="register">
          <UserRegister />
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import UserLogin from '../components/user/UserLogin.vue'
import UserRegister from '../components/user/UserRegister.vue'

const activeTab = ref('login')

const handleTabChange = (tabName) => {
  activeTab.value = tabName
}
</script>

<style scoped>
.user-auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #e0f7fa, #f8f9fa);
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 900px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.auth-tabs {
  padding: 20px;
}

@media (max-width: 768px) {
  .auth-card {
    margin: 10px;
  }
}
</style>